<%@ page import="cn.yunhe.news.dao.IBoardDao" %>
<%@ page import="cn.yunhe.news.dao.impl.BoardDao" %>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    request.setCharacterEncoding("UTF-8");
    response.setCharacterEncoding("UTF-8");

    String bname = request.getParameter("bname");
    if ("".equals(bname)){
        out.print("<script>alert('不能为空!!!');</script>");
        request.getRequestDispatcher("addzt.jsp").forward(request,response);
        return;
    }
    IBoardDao boardDao = new BoardDao();
    if (boardDao.addBoard(bname)){
        response.sendRedirect("addzt.jsp");
    }else {
        out.print("<script>alert('添加错误,请联系开发部门!!!');</script>");
    }
%>
</body>
</html>
